<!--conf
<sample>
              <product version="1.5" edition="pro"/>
                     <modifications>
                            <modified date="070101"/>
                     </modifications>
               </sample>
 --> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Numeric filtering and master checkbox</title>
	
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxgrid.css">
<script src="../../codebase/dhtmlxcommon.js" type="text/javascript"></script>
<script src="../../codebase/dhtmlxgrid.js" type="text/javascript"></script>
<script src="../../codebase/dhtmlxgridcell.js" type="text/javascript"></script>
<script src="../../codebase/ext/dhtmlxgrid_filter.js" type="text/javascript"></script>
<style>
		div.gridbox div.ftr td{
			text-align:right;
			background-color:#E5F2F8;
			border-right:0px solid gray;
		}
		div.gridbox_light table.hdr td {
			text-align:center;
		}
	</style>
</head>

<body>
<link rel='STYLESHEET' type='text/css' href='../common/style.css'>
<table cellspacing="0" cellpadding="0" class="sample_header" border="0">
	<tr valign="middle">
		<!-- COMPONENT ICON -->
		<td width="40" align="center"><img src="../common/dhtmlxgrid_icon.gif" border="0"></td>
		<!-- COMPONENT NAME -->
		<td width="150" align="left" nowrap="true">Sample: dhtmlxGrid</td>
		<!-- SAMPLE TITLE -->
		<td width="0" align="left" nowrap><b>Numeric filtering and master checkbox</b></td>
		<!-- LINK TO COMPONENT PAGE -->
		<td width="0" align="right"><a href="http://www.dhtmlx.com/docs/products/dhtmlxGrid/index.shtml">dhtmlxGrid main page</a></td>
		<!-- CLOSE BUTTON -->
		<td width="50"><div class="sample_close"><a href="javascript:void(0);" onclick="self.close();"><img src="../common/sample_close.gif" width="14" height="14" border="0" alt="X"></a></div></td>
	</tr>
</table>
	
<p> Grid provides filtering by a numeric value. Just try to enter value in the header. And setting of special parameters in footer allows to process column's numeric data.<br/>
Sample also demonstates the master checkbox in the header. Try to select checkbox and all cell's in a column will be checked, and vice versa. 
</p>
	
	<table width="600px">
		<tr>
			<td>
				<div id="gridbox" width="100%" height="350px" style="background-color:white;"></div>
			</td>
		</tr>
		<tr>
			<td>

            </td>
		</tr>
	</table>
<div class='sample_code'><div class="hl-main"><pre><span class="hl-code"> 
</span><span class="hl-identifier">mygrid</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">dhtmlXGridObject</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">gridbox</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-identifier">mygrid</span><span class="hl-code">.</span><span class="hl-identifier">setHeader</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">Sales,Book Title,Author,Price,In Store,Shipping,Bestseller,Date of Publication</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
...
</span><span class="hl-identifier">mygrid</span><span class="hl-code">.</span><span class="hl-identifier">attachHeader</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">1,2,3,#numeric_filter,#master_checkbox,6,7,8</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
...
</span><span class="hl-identifier">mygrid</span><span class="hl-code">.</span><span class="hl-identifier">attachFooter</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string"> ${#stat_total},Total sales,-,#cspan,#cspan,#cspan,#cspan,#cspan</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-identifier">mygrid</span><span class="hl-code">.</span><span class="hl-identifier">attachFooter</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">{#stat_max},Max sales,-,#cspan,#cspan,#cspan,#cspan,#cspan</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-identifier">mygrid</span><span class="hl-code">.</span><span class="hl-identifier">attachFooter</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">{#stat_min},Min sales,-,#cspan,#cspan,#cspan,#cspan,#cspan</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-identifier">mygrid</span><span class="hl-code">.</span><span class="hl-identifier">attachFooter</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">{#stat_average},Average sales,-,#cspan,#cspan,#cspan,#cspan,#cspan</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-identifier">mygrid</span><span class="hl-code">.</span><span class="hl-identifier">attachFooter</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">{#stat_count},Count of rows,-,#cspan,#cspan,#cspan,#cspan,#cspan</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-identifier">mygrid</span><span class="hl-code">.</span><span class="hl-identifier">attachFooter</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">${#stat_multi_total}0:3,Total sum (Sales*Price),-,#cspan,#cspan,#cspan,#cspan,#cspan</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;</span></pre></div></div>
<script>



	mygrid = new dhtmlXGridObject('gridbox');
	mygrid.setImagePath("../../codebase/imgs/");
	mygrid.setHeader("Sales,Book Title,Author,Price,In Store,Shipping,Bestseller,Date of Publication");
	mygrid.attachHeader("1,2,3,#numeric_filter,#master_checkbox,6,7,8");
	mygrid.setInitWidths("80,170,100,80,80,80,80,200")
	mygrid.setColAlign("right,left,left,right,center,left,center,center")
	mygrid.setColTypes("ed,edtxt,ed,price,ch,co,ra,ro");

	mygrid.init();
	mygrid.setSkin("light")
	mygrid.attachFooter(' ${#stat_total},Total sales,-,#cspan,#cspan,#cspan,#cspan,#cspan');
	mygrid.attachFooter('{#stat_max},Max sales,-,#cspan,#cspan,#cspan,#cspan,#cspan');
	mygrid.attachFooter('{#stat_min},Min sales,-,#cspan,#cspan,#cspan,#cspan,#cspan');
	mygrid.attachFooter('{#stat_average},Average sales,-,#cspan,#cspan,#cspan,#cspan,#cspan');
	mygrid.attachFooter('{#stat_count},Count of rows,-,#cspan,#cspan,#cspan,#cspan,#cspan');
	mygrid.attachFooter('${#stat_multi_total}0:3,Total sum (Sales*Price),-,#cspan,#cspan,#cspan,#cspan,#cspan');
	mygrid.loadXML("grid.xml");
</script>

<!-- FOOTER -->
<table callspacing="0" cellpadding="0" border="0" class="sample_footer"><tr><td style="padding-left: 8px;">&copy; <a href="http://www.dhtmlx.com">DHTMLX LTD</a>. All rights reserved</td></tr></table>
<!-- FOOTER -->

</body>
</html>
